<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.5,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 设置苹果工具栏颜色 -->
    <meta name="format-detection" content="telphone=no, email=no" />
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
    <meta name="HandheldFriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="MobileOptimized" content="320">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <!-- QQ强制全屏 -->
    <meta name="x5-fullscreen" content="true">
    <!-- UC应用模式 -->
    <meta name="browsermode" content="application">
    <!-- QQ应用模式 -->
    <meta name="x5-page-mode" content="app">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>虾客云-个人中心</title>
    <link rel="stylesheet" href="{{asset('css/reset.css')}}">
    <link rel="stylesheet" href="{{asset('css/main.css')}}">
    <link rel="stylesheet" href="{{asset('css/index.css')}}">
    <link rel="stylesheet" href="{{asset('css/yd_rl.css')}}" />
</head>
<body> 
    <!-- 公共头部 -->
    <div class="g2_head-bg">
        <!-- 返回上一层 -->
        <p class="g2_head_goback-bg fl">
            <a href="{{url('/')}}">
                <img src="images/xky_icon0-1.png" class="g2_head_goback_icon fl" alt="">
                <span class="g2_head_goback_del fl">返回</span>
            </a>
        </p>
        <p class="ym-tit fl">个人中心</p>
        <div class="cl"></div>
    </div>

    <!-- 个人中心详情  更改个人信息 -->
    <form action="javascript:" id="formid" method="post">
        <input type="hidden" name="id" value="{{$list->id}}">
        <p style="height:100px;"></p>
        <ul class="grzx_xq-bg">
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">员工姓名</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="username" class="grzx_xgsjhm" value="{{$list->username}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">性别</p>
                    <p class="grzx_xgname_del fr">
                        <label class="grzx_sexinp-bg fr">
                            <input class="grzx_sexinp fr" name="sex" @if ($list->sex === 2) checked @else @endif type="radio" value="2" />
                            <span class="fr" style="margin-right:5%;">女</span>
                        </label>
                        <label class="grzx_sexinp-bg fr">
                            <input class="grzx_sexinp fr" name="sex" @if ($list->sex === 1) checked @else @endif type="radio" value="1" />
                            <span class="fr" style="margin-right:5%;">男</span>
                        </label>
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">民族</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="minzu" class="grzx_xgsjhm" value="{{$list->minzu}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">手机号码</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="phone" class="grzx_xgsjhm" value="{{$list->phone}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">身份证号</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="sfz" class="grzx_xgsjhm" value="{{$list->sfz}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">住址</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="address" class="grzx_xgsjhm" value="{{$list->address}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">联系人</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="lxr" class="grzx_xgsjhm" value="{{$list->lxr}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">联系人电话</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="lxrphone" class="grzx_xgsjhm" value="{{$list->lxrphone}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">密码</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="password" name="password" class="grzx_xgsjhm" value="{{$list->password}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">确认密码</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="password" name="repassword" class="grzx_xgsjhm" value="{{$list->password}}">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list" style="position:relative;">
                    <p class="grzx_xgname fl">入职时间</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="rzdate" class="grzx_xgsjhm" value="{{$list->rzdate}}" readonly="readonly">
                    </p>
                    <div class="cl"></div>
                </li>
                <li class="grzx_xq_list">
                    <p class="grzx_xgname fl">个人备注</p>
                    <p class="grzx_xgname_del grzx_xgsjhm-bg fr">
                        <input type="text" name="beizhu" class="grzx_xgsjhm" value="{{$list->beizhu}}">
                    </p>
                    <div class="cl"></div>
                </li>
        </ul>
                        <!-- <div class="start_date_right">
                            <input type="text" name="start_date" id="start_date" placeholder="选择开始日期" readonly="readonly" />
                        </div> -->
        <!-- 按钮 -->
        <div class="grzx_cz_btns">
            <input type="reset" class="grzx_cx_btn fl" value="撤 销">
            <input type="submit" class="grzx_tj_btn fr" value="提 交">
            <div class="cl"></div>
        </div>
    </form>
    
    <!-- 遮罩 loading -->
    <div class="z2_loading-bg" style="width:100%;height:100%;background:rgba(255,255,255,0.6);position:fixed;;left:0;top:0;display:none;">
        <img src="{{asset('images/loading1.gif')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <div class="duihao" style="width:100%;height:100%;position:fixed;;left:0;top:0;display:none;">
        <img src="{{asset('images/duihao.png')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <!-- 提示信息 --> 
    <p id="tishi" style="display:none;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;width:94%;height:8vw;line-height:8vw;color:#fff;font-size:1.6rem;text-align:center;background:rgba(0,0,0,0.5);border-radius:4px;"></p>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('js/fastclick.min.js')}}"></script>
</body>
    <script src="{{asset('js/index.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
        $(function () {
            FastClick.attach(document.body);
        });
        $('.grzx_tj_btn').click(function(){
            if($("input[name='username']").val()==''){
                $("#tishi").html('不能为空');
                $("#tishi").stop(true, true).fadeIn('fast');
                $("#tishi").fadeOut(1500);
            }else if($("input[name='phone']").val()!='' && $("input[name='phone']").val().length !=11){
                $("#tishi").html('手机号码必须11位数字');
                $("#tishi").stop(true, true).fadeIn('fast');
                $("#tishi").fadeOut(1500);
            }else if($("input[name='sfz']").val()!='' && $("input[name='sfz']").val().length !=18){
                $("#tishi").html('身份证号码必须18位');
                $("#tishi").stop(true, true).fadeIn('fast');
                $("#tishi").fadeOut(1500);
            }else if($("input[name='password']").val()==''){
                $("#tishi").html('密码不能为空');
                $("#tishi").stop(true, true).fadeIn('fast');
                $("#tishi").fadeOut(1500);
            }else if($("input[name='password']").val() != $("input[name='repassword']").val()){
                    $("#tishi").html('密码不一致');
                    $("#tishi").stop(true, true).fadeIn('fast');
                    $("#tishi").fadeOut(1500);
            }else{
                var d = {};
                var t = $('#formid').serializeArray();
                $.each(t, function() {
                  d[this.name] = this.value;
                });
                var data=JSON.stringify(d);
                $.ajax({
                    url:"{{url('user')}}",
                    type:'post', //GET
                    async:false,    //或false,是否异步
                    data:{'_token':'{{csrf_token()}}','data':data},
                    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                    beforeSend:function(){
                        console.log('发送前');
                        $('.z2_loading-bg').css('display','block');
                    },
                    success:function(data){
                        if(data==true){
                            $('.z2_loading-bg').css('display','none');
                            $('.duihao').show();
                            $('.duihao').hide(1000);
                        }
                    },
                    complete:function(){
                        window.location.reload();//刷新頁面
                    }
                })
            }
        })
    </script>
</html>